Skip to content

feat(memory): 6 offline memory verbs via MemoryClient/DirectClient (M2b)#216

Merged
vreshch merged 1 commit into
masterfrom
feature/m2b-memory-verbs
Jul 6, 2026
Merged

feat(memory): 6 offline memory verbs via MemoryClient/DirectClient (M2b)#216
vreshch merged 1 commit into
masterfrom
feature/m2b-memory-verbs

Conversation

@vreshch

@vreshch vreshch commented Jul 6, 2026

Copy link
Copy Markdown
Member

Second slice of M2 - the 6 agentage memory verbs, offline. Completes the offline CRUD surface (M2a shipped the index; this ships the verbs over it).

What

  • memory search / read / write / edit / list / delete - full offline CRUD over the store + FTS5 index. Vault by @<vault>/<path> or --vault (single-vault default). --json on every verb.
  • MemoryClient seam ([[daemon-index-ownership]] V10): this PR is the DirectClient (in-process) impl; the DaemonClient lands with the daemon (M2.5). Verbs never touch SQLite or the store directly - so nothing here reworks when the daemon becomes the default path.
  • vault-store.ts - markdown CRUD + YAML frontmatter (title/tags), soft-delete to .trash/ (recoverable), safeJoin path-safety (no escape).
  • memory-edit.ts - strReplace + editBody ported verbatim from @agentage/memory-core local-ops: exact + unique match, canonical error strings, new_str omitted = delete, str_replace + --body = error, no fuzzy fallback.
  • 8 MB per-doc cap on account (couchdb) vaults; bounded read + bounded search page.
  • vault-scan gains reconcileIndex() so DirectClient refreshes a warm index before search/list.
  • Vitest 4: execArgv moved to the top-level test option (poolOptions was removed).

Verify

  • npm run verify green: type-check (src + e2e), eslint, prettier, 158 unit tests, build. Coverage 87 / 86 / 76 / 89.
  • Ran the built binary end to end: vault add -> memory write @main/notes/a.md --frontmatter {...} -> search (bm25 snippet) -> read (frontmatter stripped) -> edit --old/--new -> read (changed) -> list -> delete (soft; file present in .trash/) -> list empty.
  • Offline @p0 e2e passes locally (npx playwright test memory-offline, 2 passed, 2.2s): the full round trip + the canonical "Multiple occurrences" str_replace error.
  • Unit tests: str_replace all branches (canonical errors verbatim), resolveEdit modes, store read/write/edit/soft-delete/frontmatter/path-escape, DirectClient roundtrips + @vault/--vault/ambiguous/unknown resolution + 8 MB cap + read truncation, command arg-mapping.

Next: M2.5 harvests the daemon (ensureDaemon + daemon-client + vault actions), which becomes the default MemoryClient path; the verbs are unchanged.

- memory search/read/write/edit/list/delete over the store + index, offline
- MemoryClient seam (V10): DirectClient in-process impl; DaemonClient lands M2.5.
  Verbs never touch SQLite/store directly
- vault-store.ts: markdown CRUD + YAML frontmatter (title/tags), soft-delete to
  .trash/, path-safety (safeJoin, no escape)
- memory-edit.ts: str_replace + editBody ported verbatim from @agentage/memory-core
  local-ops (exact+unique, canonical error strings; new_str omitted = delete;
  str_replace + body = error)
- vault resolution: @<vault>/<path> or --vault; single-vault default
- 8 MB cap on account (couchdb) vaults; bounded read + search page
- vault-scan: extract reconcileIndex() so DirectClient refreshes a warm index
- vitest 4: execArgv moved to top-level (poolOptions removed)
- offline @p0 e2e (write->search->read->edit->list->delete + canonical error)
- 158 unit + 2 e2e green; verified the built binary end to end; cov 87/86/76/89
@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

🎉 PR Validation ✅ PASSED

Commit: d09018c7e1f6907da73c21c8e67fecbabac7003b
Branch: feature/m2b-memory-verbs

Checks:

  • ✅ Release guard (no version/changelog changes)
  • ✅ Dependencies installed
  • ✅ Type check passed
  • ✅ Linting passed
  • ✅ Format check passed
  • ✅ Tests + coverage passed
  • ✅ Build successful

Ready to merge!


🔗 View workflow run
⏰ Generated at: 2026-07-06T00:30:02.324Z

@vreshch vreshch marked this pull request as ready for review July 6, 2026 00:31
@vreshch vreshch merged commit ff67056 into master Jul 6, 2026
2 checks passed
@vreshch vreshch deleted the feature/m2b-memory-verbs branch July 6, 2026 00:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant